import 'package:flutter/cupertino.dart';

/**
 * 监听路由页面，切换事件调用
 *
 *
 */

class AppRouterPageUtils{
  //这是实际上的路由监听器
  static final RouteObserver<ModalRoute<void>> _routeObserver =
  RouteObserver<ModalRoute<void>>();
  static final AppRouterPageUtils _appRouteObserver =
  AppRouterPageUtils._internal();

  AppRouterPageUtils._internal() {

  }
  //通过单例的get方法轻松获取路由监听器
  RouteObserver<ModalRoute<void>> get routeObserver {
    return _routeObserver;
  }

  factory   AppRouterPageUtils() {
    return _appRouteObserver;
  }
}